//
//  UITextField+Style.m
//  TryToWtrie
//
//  Created by 钱金军 on 2018/10/26.
//  Copyright © 2018年 钱金军. All rights reserved.
//

#import "UITextField+Style.h"

@implementation UITextField (Style)

-(UITextField *)setText:(NSString *)text withTextColor:(UIColor *)color withTextFont:(UIFont *)font{
    
    self.text = text;
    self.textColor = color;
    self.font = font;
    
    UIView *rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, self.frame.size.height)];//宽度根据需求进行设置，高度必须大于 textField 的高度
    rightView.backgroundColor = [UIColor clearColor];
    //设置左侧视图的显示模式
    self.leftViewMode = UITextFieldViewModeAlways;
    self.leftView = rightView;
    
    return self;
}

-(UITextField *)setText:(NSString *)text withTextColor:(UIColor *)color withTextFont:(UIFont *)font withBorderColor:(UIColor *)borderColor{
    
    self.text = text;
    self.textColor = color;
    self.font = font;
    
    self.layer.borderColor = borderColor.CGColor;
    self.layer.borderWidth = 0.5;
    
    UIView *rightView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, self.frame.size.height)];//宽度根据需求进行设置，高度必须大于 textField 的高度
    rightView.backgroundColor = [UIColor clearColor];
    //设置左侧视图的显示模式
    self.leftViewMode = UITextFieldViewModeAlways;
    self.leftView = rightView;
    
    return self;
}


@end
